 
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>	
	用户名：<input type="text" id="name">
					<br/>
		密&nbsp; &nbsp; 码：<input type="text" id="pwd"><br />
		&nbsp; &nbsp; &nbsp; <input type="button" value="提交" onclick="confime()" />
		&nbsp; &nbsp; <input type="button" value="查看" onclick="displaycooikes()" />
 
<script>
	function confime(){
		var sname=document.getElementById("name").value
		var spwd=document.getElementById("pwd").value
		if(sname=="123"&&spwd=="321"){
			window.open("关闭广告.html")
		}
		else
		{
			alert("用户名或密码错误!");		
		}
				
	}
	function displaycooikes(){
		var myname= new Array()
		var myvalue= new Array()
		var str=""
		var cookiesstring=document.cookie
		var cookiessarray = cookiesstring.split(";")
		for(var i=0;i<cookiessarray.length;i++){
			var cookienum= cookiessarray[i].split("=")
			myname[i]=cookienum[0]
			myvalue[i]=cookienum[1]
		}
		alert(cookiesstring)
		alert("cookies信息是"+myname[0]+myvalue[0]+myname[1]+myvalue[1])
	}
</script>
				 
	
	</body>
</html>